<template>
    <div>
        <!-- 三级联动组件已经是全局组件不需要注册了
       -->
        <TypeNav></TypeNav>
        <ListContainer></ListContainer>
        <Recommend></Recommend>
        <Rank></Rank>
        <Like></Like>
        <Floor v-for="floor in getFloorList" :key="floor.id" :list="floor"></Floor>
        <Brand></Brand>
    </div>
</template>

<script>
import ListContainer from "@/pages/Home/ListContainer";
import Recommend from "@/pages/Home/Recommend";
import Rank from "@/pages/Home/Rank";
import Like from "@/pages/Home/Like";
import Floor from "./Floor/index.vue";
import Brand from "./Brand/index.vue";
import { mapState } from 'vuex'
    export default {
    name: "Home",
    components: { ListContainer, Recommend, Rank, Like, Floor, Brand },
    created(){
            //派发action,获取floor组件的数据
            this.$store.dispatch('getFloorList');
    },  
    computed:{
            //通过mapState计算属性获取state中的图片数据
            ...mapState({
                getFloorList:state=>state.home.getFloorList
            })
    },
}
</script>

<style>

</style>